package com.erp.system.service.impl;

import com.erp.system.domain.MaterialReplace;
import com.erp.system.mapper.MaterialReplaceMapper;
import com.erp.system.service.MaterialReplaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * FileName: MaterialReplaceServiceImpl.java
 * 业务层接口实现类的详细说明
 *
 * @author 类创建者姓名
 * @version 1.00
 * @Date 创建日期
 */
@Service
public class MaterialReplaceServiceImpl implements MaterialReplaceService {

    @Autowired
    private MaterialReplaceMapper materialReplaceMapper;

    @Override
    public List<MaterialReplace> queryAll(MaterialReplace materialReplace) {
        return materialReplaceMapper.queryAll(materialReplace);
    }

    @Override
    public int insert(MaterialReplace materialReplace) {
        return materialReplaceMapper.insert(materialReplace);
    }

    @Override
    public MaterialReplace queryById(String id) {
        MaterialReplace param = new MaterialReplace();
        param.setId(id);
        return queryAll(param).stream().findFirst().orElse(param);
    }

    @Override
    public int update(MaterialReplace materialReplace) {
        return materialReplaceMapper.update(materialReplace);
    }

    @Override
    public int delete(String[] ids) {
        return materialReplaceMapper.delete(ids);
    }
}
